import {
	WTM_ValueType
} from '../../../common/wtm/declare.js'

const SchoolType = [{
		Text: "公立学校",
		Value: "PUB"
	},
	{
		Text: "私立学校",
		Value: "PRI"
	}
];

//参数
export const Entity ={
	ID: {
		name: ["Entity", "ID"],
		label: "学校id",
		value: ""
	},
	SchoolCode: {
		name: ["Entity", "SchoolCode"],
		label: "学校编号",
		value: ""
	},
	SchoolName: {
		name: ["Entity", "SchoolName"],
		label: "学校名称",
		value: "",
		rules: [{
				required: true,
				errorMessage: '请输入用户名'
			},
			{
				minLength: 3,
				maxLength: 15,
				errorMessage: '姓名长度在 {minLength} 到 {maxLength} 个字符'
			}
		]
	},
	SchoolType: {
		name: ["Entity", "SchoolType"],
		label: "学校类型",
		value: "PUB",
		type: WTM_ValueType.select,
		request: SchoolType,
		index: 0
	},
	// SchoolImage:{
	// 	name: ["Entity", "SchoolImage"],
	// 	label: "学校图片",
	// 	value:[],
	// 	type:WTM_ValueType.image,
	// 	count:10,//默认1
	// 	//sizeTypeIndex:2,//0:压缩 1：原图 2：压缩或原图 默认2
	// 	//sourceTypeIndex:2//0：拍照 1：相册 2：拍照或相册 默认2
	// },
	Remark: {
		name: ["Entity", "Remark"],
		label: "备注",
		value: ""
	}
}

export const PageEntity =JSON.parse(JSON.stringify(Entity))

//页码
export const Pagination = {
	Page: 1,
	Limit: 5,
	Deletes:false,
	Ids:[]
}

//列表  列名
export const EntityTable = {
	// ID: {
	// 	name: ["Entity", "ID"],
	// 	label: "ID"
	// },
	SchoolCode: {
		name: ["Entity", "SchoolCode"],
		label: "学校编号",
	},
	SchoolName: {
		name: ["Entity", "SchoolName"],
		label: "学校名称",
	},
	SchoolType: {
		name: ["Entity", "SchoolType"],
		label: "学校类型"
	},
	Remark: {
		name: ["Entity", "Remark"],
		label: "备注",
	}

}

//初始化Entity数据
const Model=['ID','SchoolCode','SchoolName','SchoolType','Remark'];
export const NewEntity=function(){
	console.log(JSON.stringify(PageEntity))
	Model.map(item=>{
		Entity[item].value=PageEntity[item].value;
	})
}